package com.qiaoba.module.system.entity.dto;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 岗位 DTO
 *
 * @author ailanyin
 * @date 2023-09-10 08:42:59
 */
@Data
public class SysPostDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "岗位ID")
    @NotNull(message = "岗位ID不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "岗位ID不能超过{max}个字符", groups = {EditGroup.class})
    private String postId;

    @Schema(description = "岗位名称")
    @NotBlank(message = "岗位名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 50, message = "岗位名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String postName;

    @Schema(description = "岗位编码")
    @NotBlank(message = "岗位编码不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 50, message = "岗位编码不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String postCode;

    @Schema(description = "岗位排序")
    @Min(value = 1, message = "排序最小允许: {value}", groups = {AddGroup.class, EditGroup.class})
    private Integer postSort;

    @Schema(description = "状态(0->禁用,1->正常)")
    @NotBlank(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String remark;
}
